package STUDENT.TranNamAnh.OOPs.baitapmang.bt2;

import java.util.Scanner;

public class Views {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Controllers c_col = new Controllers();
		
		int chon = 0 ;
		int i = 0;
		int i_value = 0;
		double d_value = 0;	
		double[] d_Arr = new double[100];
		int [] i_Arr = new int[100];
		
		
		System.out.println("Nhap kieu so ban muon tinh");
		System.out.println("1 la double 2 la int");
		chon = sc.nextInt();
		if(chon == 1){
			
			while(d_value>=0.0){
				System.out.println("Nhap thanh phan mang");
				d_value = sc.nextDouble();
				d_Arr[i] = d_value;
				i++;
				sc = new Scanner(System.in);
			}
			System.out.println("Ket qua day so tren la: " + c_col.tinhtoan(d_Arr));
		}
		if(chon ==2){
			while(i_value>=0){
				System.out.println("Nhap thanh phan mang");
				i_value = sc.nextInt();
				i_Arr[i] = i_value;
				i++;
				sc = new Scanner(System.in);
			}
		
		System.out.println("Ket qua day so tren la: " + c_col.tinhtoan(i_Arr));
		}
		
			
	}

	
}
